package com.woke.data;

/**
 * 作者 : Administrator
 * 创建时间 :  2017/6/26 0026.
 * 备注 :
 */

public enum EnumCardType {
    DEFAULT_CARDS("全部", 0), RECHARGE_CARDS("充值卡", 1), ACCOUNT_CARDS("到账卡", 2);

    private final String valueName;
    private final int value;

    EnumCardType(String valueName, int value) {

        this.valueName = valueName;
        this.value = value;
    }

    public String getValueName() {
        return valueName;
    }

    public int getValue() {
        return value;
    }

    public static EnumCardType getCardTypeFromValue(int value) {
        switch (value) {
            case 1:
                return RECHARGE_CARDS;
            case 2:
                return ACCOUNT_CARDS;
            default:
                return DEFAULT_CARDS;
        }
    }
}
